#ifndef RSIM_INDEX_H
#define RSIM_INDEX_H

/* -------------------------------------------------------------------------- *
 * File: Index.h                                                              *
 * Authors: Kishor Bhalerao                                                   *
 * Email : kishor8dm@gmail.com                                                *
 * Contributors:                                                              *
 * Email:                                                                     *
 * copyright (c) 2010 Authors.                                                *
 *                                                                            *
 * This program is free software: you can redistribute it and/or modify it    *
 * under the terms of the GNU General Public License as published by the Free *
 * Software Foundation, either version 3 of the License, or any later version.*
 *                                                                            *
 * This program is distributed in the hope that it will be useful, but        *
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   *
 * for more details. (http://www.gnu.org/licenses/)                           *
 * -------------------------------------------------------------------------- */

#include <iostream>
using namespace std;

namespace RSIM{
        
////////////////////////////////////////////////////////////////////////
//	Class:SystemIndex
////////////////////////////////////////////////////////////////////////

class SystemIndex{
        private:
                int id_;
                SystemIndex();
        public:
                explicit SystemIndex(const int& i):id_(i){
                        if(id_<-1){
                                cout<<"\nSystemIndex(const int&), SystemIndex cannot be lower than -1. Exiting...\n";
                                exit(0);
                        }
                }
                const int id()const{return id_;}
};

////////////////////////////////////////////////////////////////////////
//	Class:NodeIndex
////////////////////////////////////////////////////////////////////////

class NodeIndex{
        private:
                int id_;
                NodeIndex();
        public:
                explicit NodeIndex(const int& i):id_(i){
                        #ifdef RSIM_SAFE
                        if(id_<0){
                                cout<<"\nNodeIndex(const int&), NodeIndex cannot be lower than 0. Exiting...\n";
                                exit(0);
                        }
                        #endif
                }
                
                const int id()const{return id_;}
};
        
////////////////////////////////////////////////////////////////////////
//	Class:BodyIndex
////////////////////////////////////////////////////////////////////////

class BodyIndex{
        private:
                int id_;
                /** Illegal constructor */
                BodyIndex();
                
                /** Illegal constructor */
                BodyIndex(const BodyIndex&);
        public:
                
                explicit BodyIndex(const int& i):id_(i-1){                        
                        if(id_<0){
                                cout<<"\nBodyIndex(const int&), BodyIndex cannot be lower than 1. Exiting...\n";
                                exit(0);
                        }
                }
                
                const int id() const{return id_;}
};

////////////////////////////////////////////////////////////////////////
//	Class:QIndex
////////////////////////////////////////////////////////////////////////

class QIndex{
        private:
                int id_;
                
                /** Illegal constructor */
                QIndex();
                
                /** Illegal constructor */
                QIndex(const QIndex&);
        public:		
                explicit QIndex(const int& i):id_(i){}
                
                const int id() const{return id_;}
};

////////////////////////////////////////////////////////////////////////
//	Class:UIndex
////////////////////////////////////////////////////////////////////////

class UIndex{
        private:
                int id_;
                
                /** Illegal constructor */
                UIndex();
                
                /** Illegal constructor */
                UIndex(const UIndex&);
        public:		
                explicit UIndex(const int& i){                        
                        if(id_<0){
                                cout<<"\nQIndex(const int&), QIndex cannot be lower than 0. Exiting...\n";
                                exit(0);
                        }
                }
                
                const int id() const{return id_;}
};


}// namespace RSIM
#endif